<template>
    <AuthLayout>
        <el-menu-item>
              <el-dropdown trigger="hover">
                <span class="avatar">
                  <img src="https://via.placeholder.com/40" alt="用户头像" class="avatar-img" />
                </span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item>个人信息</el-dropdown-item>
                  <el-dropdown-item>设置</el-dropdown-item>
                  <el-dropdown-item>退出登录</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </el-menu-item>
      
    </AuthLayout>
  </template>
  
  <script setup>
  import { ref } from 'vue';
  import { ElMessage } from 'element-plus';
  import { useRouter } from 'vue-router';
  import AuthLayout from '@/layouts/AuthLayout.vue';
  
  const registerForm = ref({
    username: '',
    email: '',
    password: '',
    confirmPassword: ''
  });
  
  const router = useRouter();
  
  const validatePassword = (rule, value, callback) => {
    if (value !== registerForm.value.password) {
      callback(new Error('两次输入的密码不一致'));
    } else {
      callback();
    }
  };
  
  const register = () => {
    if (!registerForm.value.username || !registerForm.value.email || !registerForm.value.password || !registerForm.value.confirmPassword) {
      ElMessage.error('请填写完整的注册信息');
      return;
    }
  
    ElMessage.success('注册成功');
    router.push({ name: 'HomePage' });
  };
  
  const goLogin = () => {
    router.push({ name: 'LoginPage' });
  };
  </script>
  
  <style scoped>

  </style>
  